﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div id="container">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>

        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
        <asp:GridView ID="GVgiohang" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" ForeColor="#333333" GridLines="None" Width="100%" 
                    onrowcommand="GVgiohang_RowCommand" ShowFooter="True" 
                    DataKeyNames="masanpham" onrowdatabound="GVgiohang_RowDataBound">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField HeaderText="Hình Sản Phẩm">
                    <ItemTemplate>
                        <a href="ProductDetail.aspx?masp=<%#Eval("Masanpham") %>"><img  src="ImagesProduct/<%#Eval("hinh") %>" alt="<%#Eval("Tensanpham") %>" style="border:1px solid #e0e0e0" width="100px" height="100px" /></a>
                        <br />
                        <asp:Button ID="bt_xoa" runat="server" Text="Xóa" 
                            CommandArgument='<%# Eval("Masanpham") %>' CommandName="xoa" 
                            OnClientClick="return confirm('Bạn có chắc muốn xóa sản phẩm này trong giỏ hàng')" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Tensanpham" HeaderText="Tên Sản Phẩm" />
                <asp:TemplateField HeaderText="Số lượng">
                    <FooterTemplate>
                        <table class="style1">
                            <tr>
                                <td align="right">
                                    <asp:Label ID="Label1" runat="server" Text="Tổng Số Mặt Hàng"></asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="lb_mathang" runat="server" Text="Label"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="Label3" runat="server" Text="Tổng Tiền"></asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="tongtien" runat="server" Text="Label"></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:TextBox ID="So_luong" runat="server" Text='<%# Eval("So_luong") %>' 
                            Width="50px"></asp:TextBox>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Giaban" HeaderText="Giá Bán" 
                    DataFormatString="{0:#,##0 VND}" >
                <ItemStyle Font-Bold="True" />
                </asp:BoundField>
                <asp:BoundField DataField="thanh_tien" HeaderText="Thành Tiền" 
                    DataFormatString="{0:#,##0 VND}" >
                
                <ItemStyle Font-Bold="True" ForeColor="Red" />
                </asp:BoundField>
                
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" 
                BorderStyle="Solid" BorderWidth="1px" HorizontalAlign="Center" 
                VerticalAlign="Middle" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" BorderStyle="None" HorizontalAlign="Center" 
                VerticalAlign="Middle" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
        <div id="btchucnang">
            <div id="muatiep"><a href="#">Tiếp tục mua hàng</a></div>
            <div id="capnhatgiohang">
                <asp:ImageButton ID="bt_capnhat" runat="server" 
                    ImageUrl="~/images/capnhat_giohang.jpg" onclick="bt_capnhat_Click" 
                    onclientclick="return alert('Cập nhật thành công')" /></div>
        </div>
        </ContentTemplate>
         </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
